﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link href="~/Content/AUI/css/aui.css" rel="stylesheet" />
    <link href="~/Content/AUI/css/aui-flex.css" rel="stylesheet" />
</head>
<body>
    <div class="aui-content">
        <header class="aui-bar aui-bar-nav aui-bar-light">
            <a tapmode onclick="javascript: history.back(-1)" class="aui-pull-left"><span class="aui-iconfont aui-icon-left"></span></a>
            <span style="margin-left:-50px">填写预约信息</span>
        </header>
    </div>
    <form id="Submitinfo">
        <div class="aui-content">
            <div class="aui-form">
                <div class="aui-content aui-margin-b-15">
                    <ul class="aui-list aui-form-list">
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">
                                    姓名
                                </div>
                                <div class="aui-list-item-input">
                                    <input type="text" name="AOName" id="AOName" placeholder="请输入您的姓名">
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">
                                    性别
                                </div>
                                <div class="aui-list-item-input">
                                    <label><input class="aui-radio" type="radio" value="1" name="AOSex" checked> 男</label>
                                    <label><input class="aui-radio" type="radio" value="0" name="AOSex"> 女</label>
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">
                                    身份证号
                                </div>
                                <div class="aui-list-item-input">
                                    <input type="number" name="AOIdNumber" id="AOIdNumber" placeholder="请输入证件号码">
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">
                                    婚否
                                </div>
                                <div class="aui-list-item-input">
                                    <label><input class="aui-radio" type="radio" value="1" name="AOMarried" checked> 是</label>
                                    <label><input class="aui-radio" type="radio" value="0" name="AOMarried"> 否</label>
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">
                                    出生年月
                                </div>
                                <div class="aui-list-item-input">
                                    <input type="date" name="AOBirthday" id="AOBirthday" placeholder="请选择您的出生年月">
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">
                                    手机号码
                                </div>
                                <div class="aui-list-item-input">
                                    <input type="number" name="AOContactTel" id="AOContactTel" placeholder="请输入手机号码">
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </form>
    <footer class="aui-bar aui-bar-tab" id="footer">
        <div class="aui-bar aui-bar-nav aui-bar-btn-sm" onclick="PostInfo()">
            下一步
        </div>
    </footer>
</body>
</html>
<script src="~/Content/AUI/script/aui-toast.js"></script>
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script>
    function PostInfo() {
        var AOName = $("#AOName").val();
        var regName = /^([\u4e00-\u9fa5]){2,7}$/;
        var AOIdNumber = $("#AOIdNumber").val();
        var regIdCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
        var AOContactTel = $("#AOContactTel").val();
        var regPhone = /^1[3|4|5|7|8][0-9]{9}$/;
        var AOBirthday = $("#AOBirthday").val();
        var Marry = $("input[name='AOMarried']:checked").val();
        var Sex = $("input[name='AOSex']:checked").val();
        if (AOName == null || AOName == "" || AOIdNumber == null || AOIdNumber == "" || AOContactTel == null || AOContactTel == "" || AOBirthday == "" || AOBirthday == null) {
            alert("信息不可为空！");
            return;
        }
        if (!regName.test(AOName)) {
            alert("请核对您输入的姓名");
            return;
        }
        if (!regIdCard.test(AOIdNumber)) {
            alert("请核对您的身份证号码");
            return;
        }
        if (!regPhone.test(AOContactTel)) {
            alert("请核对您的手机号码!");
            return;
        }
        var toast = new auiToast({
        })
        toast.loading({
            title: "加载中",
            duration: 2000
        }, function (ret) {
            console.log(ret);
            setTimeout(function () {
                toast.hide();
            }, 1000)
        });
        $.ajax({
            type: "Post",
            url: "/Mobile/Info/PostInfo",
            data: $("#Submitinfo").serialize(),
            success: function (result) {
                if (result) {
                    location.href = "/Mobile/Store/Index";
                }
            }
        })
    }
</script>